package com.example.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.dao.UserRepository;
import com.example.datasource.TargetDataSource;
import com.example.pojo.User;

@Service
public class JpaService {
	@Autowired
	private UserRepository userRepository;
	
	@TargetDataSource(name = "springboot1")
	public List<User> findUsersByName(String name){
		return userRepository.findByName(name);
	}
}
